package ControlLayer;

import ModelLayer.*;
/**
 * Write a description of class Controls here.
 * 
 * @author (your name) 
 * @version (a version number or a date)
 */
public class DVDControls
{
    private DVDContainer dvdCont;
    
    public DVDControls()
    {
        dvdCont = DVDContainer.getInstance();
    }
    
    // DVDs
    
    public void createDVDs(String barcode, String title, String artist, String publicationDate)
    {
        DVD dvdObject = new DVD(barcode, title, artist, publicationDate);
        dvdCont.addDVDs(dvdObject);
    }
    
    public void createObjects()
    {
        dvdCont.addDVDs(new DVD("123456", "Rap", "Eminem", "12.12.2012"));
        dvdCont.addDVDs(new DVD("567890", "Metal", "Metalica", "12.12.2012"));
        dvdCont.makeCopies("123456", "234567", "12.12.2012", "12");
        dvdCont.makeCopies("123456", "345678", "13.12.2013", "13");
        dvdCont.makeCopies("567890", "456789", "14.12.2014", "14");
        dvdCont.makeCopies("567890", "567890", "15.12.2015", "15");
    }
    
    public String addResult()
    {
        return dvdCont.addResult();
    }
    
    public String showDVDs(String barcode)
    {
        return dvdCont.showDVDs(barcode);
    }
    
    public void deleteDVDs(String barcode)
    {
        dvdCont.deleteDVDs(barcode);
    }
    
    public void updateDVDs(String oldBarcode, String newTitle, String newArtist, String newPublicationDate)
    {
        dvdCont.updateDVDs(oldBarcode, newTitle, newArtist, newPublicationDate);
    }
    
    public int sizeOfDVDList()
    {
        return dvdCont.sizeOfDVDList();
    }
    
    public String returnResult()
    {
        return dvdCont.deleteResult();
    }
    
    //COPIES
    
    public void createCopies(String barcode, String serialNumber, String purchaseDate, String purchasePrice)
    {
        dvdCont.makeCopies(barcode, serialNumber, purchaseDate, purchasePrice);
    }
   
    public String resultCreateCopies()
    {
        return dvdCont.resultCreateCopies();
    }
}
